//
//  MCActivityAddViewController.swift
//  StoreManage
//
//  Created by MC on 2018/9/4.
//  Copyright © 2018年 MC. All rights reserved.
//

import UIKit

class MCActivityAddViewController: MCViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        baseSetting()
        
        initUI()
        
        managerClosure()
        
        sendNetworking()
    }
    
    // MARK: - System Delegate
    
    // MARK: - Custom Delegate
    
    // MARK: - Closure
    func managerClosure() { }
    
    // MARK: - Action
    @objc func addMarketingButtonClicked() {
        let vc = MCNewMarketingViewController()
        MCPushToViewController(current: self, target: vc, isHiddenBottomBarWhenBack: true)
    }
    
    @objc func addTicketButtonClicked() {
        let vc = MCAddTicketViewController()
        MCPushToViewController(current: self, target: vc, isHiddenBottomBarWhenBack: true)
    }
    
    // MARK: - Network
    func sendNetworking() {
        
    }
    
    // MARK: - Method
    func baseSetting() {
        self.title = "新增活动"
    }
    
    func initUI() {
        view.addSubview(addMarketingButton)
        addMarketingButton.snp.remakeConstraints { (make) ->Void in
            make.centerX.equalTo(view)
            make.width.equalTo(MCScreenWidth - 90)
            make.height.equalTo(70)
            make.top.equalTo(105)
        }
        
        view.addSubview(addTicketButton)
        addTicketButton.snp.remakeConstraints { (make) ->Void in
            make.centerX.equalTo(view)
            make.width.equalTo(MCScreenWidth - 90)
            make.height.equalTo(70)
            make.top.equalTo(addMarketingButton.snp.bottom).offset(25)
        }

    }

// MARK: - Setter & Getter
    lazy var addMarketingButton: UIButton = {
        let button = UIButton.init(type: .custom)
        button.backgroundColor = UIColor.MCMain
        button.layer.cornerRadius = 5
        button.layer.masksToBounds = true
        button.titleLabel?.font = MCFont(20)
        button.setTitle("社区分销", for: .normal)
        button.setTitleColor(UIColor.white, for: .normal)
        button.addTarget(self, action: #selector(addMarketingButtonClicked), for: .touchUpInside)
        return button
    }()
    
    lazy var addTicketButton: UIButton = {
        let button = UIButton.init(type: .custom)
        button.backgroundColor = UIColor.MCMain
        button.layer.cornerRadius = 5
        button.layer.masksToBounds = true
        button.titleLabel?.font = MCFont(20)
        button.setTitle("优惠券", for: .normal)
        button.setTitleColor(UIColor.white, for: .normal)
        button.addTarget(self, action: #selector(addTicketButtonClicked), for: .touchUpInside)
        return button
    }()


}
